package com.u3k.mid;

public class bc {
    public static String a(Throwable th) {
        if (th != null) {
            try {
                StringBuilder stringBuilder = new StringBuilder();
                StackTraceElement[] stackTrace = th.getStackTrace();
                stringBuilder.append(th.toString());
                stringBuilder.append("\n");
                if (stackTrace != null) {
                    for (int i = 0; i < stackTrace.length; i++) {
                        stringBuilder.append(" file:");
                        stringBuilder.append(stackTrace[i].getFileName());
                        stringBuilder.append(" class:");
                        stringBuilder.append(stackTrace[i].getClassName());
                        stringBuilder.append(" method:");
                        stringBuilder.append(stackTrace[i].getMethodName());
                        stringBuilder.append(" line:");
                        stringBuilder.append(stackTrace[i].getLineNumber());
                        stringBuilder.append("\n");
                    }
                }
                return stringBuilder.toString();
            } catch (Exception e) {
            }
        }
        return "";
    }
}
